import socket

# def main():
#     s = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
#     txt = input('请输入你要发送的内容：')
#     p = ("172.18.104.161", 8080)
#     s.sendto(txt,p)
#     s.close()
    
# if __name__ == '__main__':
#     main()
while True:
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    txt = input('请输入你要发送的内容：')
    p = ("172.18.104.161", 8080)
    s.sendto(txt.encode('gbk'),p)
    s.close()
